package com.swt.gap.dao;

import com.github.pagehelper.Page;
import com.swt.gap.model.entity.Achievement;
import com.swt.gap.model.vo.achievementcenter.TinyAchievementInfoVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface AchievementDao {
    int deleteByPrimaryKey(Integer achievementId);

    int insertSelective(Achievement record);

    Achievement selectByPrimaryKey(Integer achievementId);

    int updateByPrimaryKeySelective(Achievement record);

    Achievement selectByName(String achievementName, Integer createdBy);

    int deleteAchievement(Integer achievementId);

    int deleteAchievementByClassId(Integer achievementClassId);

    List<TinyAchievementInfoVO> selectByUserAndKeyword(@Param("userIds")List<Integer> userIds,
                                                       @Param("keyword")String keyword);

    Page<TinyAchievementInfoVO> searchAchievement(int userId, String keyword, int orderType);

    int banchDelete(@Param("achievementIds") int[] achievementIds);

    Page<Achievement> selectByUserAndKeywordNoClass(@Param("userIds")List<Integer> userIds,
                                                       @Param("keyword")String keyword);

    int updatePassword(@Param("password") String keyword, @Param("achievementIds") List<Integer> achievementIds);
}